<template>
  <div>
    <f-search-form :more="true" @searchHandler="searchHandler" :tableObj="tableObj" :show-export-btn='true' export-url='exportUrl2'>
      <f-search-form-item label="账套"  name="areaName"   type="select"      valueKey="areaName" label-key="areaName" style="width:220px"/>
      <f-search-form-item label="商品名称" ref="dept"  name="deptId" type="select"   valueKey="deptId" label-key="deptName" style="width:220px"/>
      <f-search-form-item label="统计日期" name="orderNo" style="width: 250px"/>
    </f-search-form>
    <f-table ref="table"  rowKey="orderDetailsId" :showSetting="true"  :tableColumns="columns" :scroll="{x:true}"  :multiple="false" :operator="operator" :params="queryParam" :api="api.bod" handler="orderDetailsReportHandler">
    </f-table>

  </div>
</template>
<script>
import api from './../../js/api'

export default {
  name: 'InventoryList',
  components: {

  },
  data() {
    let me = this
    //操作按钮
    let operator = []
    let customFlag=this.$store.state.user.customFlag
    return {
      api: Object.assign(api, this.api),
      //列表初始化查询参数
      queryParam: {
        companyId:this.$store.state.user.companyId
      },
      tableObj:null,
      superAdmin: this.superAdmin,
      // 表头
      columns: [
        {
          title: '序号',
          width: '70px',
          align: 'center',
          customRender: (text, record, index) => index + 1
        },
        {
          title: '经手人',
          align: 'left',
          width: '100px',
          dataIndex: 'orderNo',
          scopedSlots: { customRender: 'orderNo' }
        },
        {
          title: '5月01日',
          align: 'left',
          width: '90px',
          dataIndex: 'orderNo',
        },
        {
          title: '5月02日',
          align: 'left',
          width: '90px',
          dataIndex: 'orderNo',
        },
        {
          title: '5月03日',
          align: 'left',
          width: '90px',
          dataIndex: 'orderNo',
        },
        {
          title: '5月29日',
          align: 'left',
          width: '90px',
          dataIndex: 'orderNo',
        },
        {
          title: '5月30日',
          align: 'left',
          width: '90px',
          dataIndex: 'orderNo',
        },
        {
          title: '5月31日',
          align: 'left',
          dataIndex: 'orderNo',
          width: '90px',
        },
        {
          title: '总计',
          align: 'left',
          dataIndex: 'orderNo',
          width: '90px',
        },
      ],
      operator: operator
    }
  },
  created() {
  },
  mounted() {
    this.tableObj=this.$refs.table
  },
  methods: {
    onCopy() {
      this.$message.success('复制成功!')
    },
    initSettle(record){
      this.http.confirm(this, {
        content: '确认初始化结算吗?',
        url: api.payment.initSettlePayment,
        data: {
          orderDetailsId: record.orderDetailsId
        }
      })
    },
    clearExport(){
      this.http.post(this, {
        url: this.api.bod.clearExportData
      })
    }
  }
}
</script>
